Skip to content

Add per-site GutenbergKit opt-in and announcement bottom sheet#22813

Draft
jkmassel wants to merge 5 commits into
trunkfrom
jkmassel/gutenbergkit-opt-in
Draft

Add per-site GutenbergKit opt-in and announcement bottom sheet#22813
jkmassel wants to merge 5 commits into
trunkfrom
jkmassel/gutenbergkit-opt-in

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

Summary

  • Adds a one-time announcement bottom sheet that surfaces the upcoming GutenbergKit editor on app start, with Try it now / Maybe later and an inline Learn more link.
  • Adds a per-site Use new block editor toggle in Site Settings so users can opt in or out at any time.
  • Persists per-site opt-in state and a one-shot "announcement shown" flag in AppPrefs.
  • Routes opted-in sites into GutenbergKit from EditorLauncher.
  • Gated on the remote feature flag (isGutenbergKitRemoteFeatureEnabled) and suppressed for sites where the block editor isn't the default (via SiteUtils.isBlockEditorDefaultForNewPost).

Changes

  • GutenbergKitAnnouncementBottomSheetFragment + gutenberg_kit_announcement_bottom_sheet.xml: New bottom sheet. Consumes top window insets so Material's BottomSheetDialog doesn't double-pad under the status bar. Inline "Learn more" ClickableSpan opens a web page via WPWebViewActivity.
  • WPMainActivityViewModel: New checkAndShowGutenbergKitAnnouncement(site) — gated on remote flag, one-shot pref, non-null site, and SiteUtils.isBlockEditorDefaultForNewPost(site).
  • WPMainActivity: Observes the announcement event and shows the fragment.
  • GutenbergKitFeatureChecker: FeatureState now carries isEnabledForSite; getFeatureState / isGutenbergKitEnabled accept an optional SiteModel. @JvmOverloads added for Java interop. New isGutenbergKitRemoteFeatureEnabled() for opt-in surfaces.
  • SiteSettingsFragment: New preference wired to AppPrefsWrapper.isGutenbergKitEnabledForSite / setGutenbergKitEnabledForSite. Visibility gated by the remote flag.
  • AppPrefs / AppPrefsWrapper: Adds GUTENBERG_KIT_ANNOUNCEMENT_SHOWN and the per-site opt-in key.
  • EditorLauncher: Passes the current site into the feature check so the per-site opt-in is honored.

Test plan

  • Fresh install with remote flag on: launch app → announcement sheet appears once; tap Try it now → editor opens in GutenbergKit; sheet does not re-appear on next launch.
  • Maybe later dismisses without opting in; sheet does not re-appear.
  • Site Settings: toggling Use new block editor opts the current site in/out; survives app restart.
  • Site with block editor disabled (mobileEditor == "aztec"): announcement sheet does not appear.
  • Remote flag off: neither the announcement nor the Site Settings toggle appear.
  • Learn more inline link opens the web page.
  • Unit tests: WPMainActivityViewModelTest, GutenbergKitFeatureCheckerTest pass.

@dangermattic
Copy link
Copy Markdown
Collaborator

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 22, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22813-f7297c3
Build Number1488
Application IDorg.wordpress.android.prealpha
Commitf7297c3
Installation URL2o16aebqp8l7o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 22, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22813-f7297c3
Build Number1488
Application IDcom.jetpack.android.prealpha
Commitf7297c3
Installation URL31rjhmc6l56lo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 22, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

jkmassel added 3 commits May 20, 2026 21:55
Surfaces the new GutenbergKit editor to users ahead of its default
rollout. Adds a one-time announcement bottom sheet on app start and a
per-site toggle in Site Settings to opt in or out. Gated on the remote
feature flag and skipped for sites where the block editor is disabled.
The announcement bottom sheet now sets a single app-wide opt-in instead
of a per-site flag. The Site Settings toggle becomes a tri-state override
(opt-in / opt-out / follow global), stored as two StringSets so absence
means "follow global."

Resolution: siteOverride ?? globalOptIn, still gated by the experimental,
remote, and kill-switch flags.
SiteUtils.isBlockEditorDefaultForNewPost is now @deprecated in favor of
SiteSettingsProvider.isBlockEditorDefault; inject the provider into the
view model and route the announcement gate through it.

Restore the GutenbergKitFeatureChecker field on SiteSettingsFragment
that was dropped during conflict resolution against trunk's new
EditorCapabilityResolver block.
@jkmassel jkmassel force-pushed the jkmassel/gutenbergkit-opt-in branch from f580ae7 to 1ff1259 Compare May 21, 2026 04:06
jkmassel added 2 commits May 21, 2026 08:15
Add javadocs to the per-site override read/write pair, the underlying
StringSet helpers, and the global opt-in + announcement-shown getters
and setters so callers can pick the right primitive without re-reading
the implementation.
The Theme Styles and Third-Party Blocks gates short-circuited on
isGutenbergKitEnabled() with no site argument, so the resolver only
saw the global opt-in and ignored per-site overrides. The launcher,
which uses the site-aware overload, could open GBKit for a site
opted in locally while the resolver still reported Hidden — the
editor would then run without those capabilities applied.

Pass site through to the checker so both gates use the same view of
"is GBKit on for this site" that the launcher does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants